﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wp.BLL;
using Wp.DAL;


public partial class Modules_Posts_Controls_Author : System.Web.UI.UserControl
{
    public string PostTextId { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        PostTextId = CommonHelper.QueryString("PostTextId", "");
        if (!IsPostBack)
        {
            LoadData();
        }
    }
    public void LoadData()
    {
        TblPostsEntity item = TblPostsManager.CreateInstant().SelectOneByTextId(PostTextId, false);
        if (item != null)
        {
            UserEntity user = new UserEntity();
            ProfileCommon userProfile = Profile.GetProfile(item.Author);
            user.UserName = item.Author;
            user.FullName = userProfile.FullName;
            user.Avatar = userProfile.Avatar;
            List<UserEntity> ls = new List<UserEntity>();
            ls.Add(user);
            rpt.DataSource = ls;
            rpt.DataBind();
        }
    }
}